<template>
  <div class="error">
    <tm-empty image="error">
      <template slot="description">
        <h1 class="code">{{ error.statusCode }}</h1>
        <h4 class="message">{{ error.message }}</h4>
      </template>
    </tm-empty>
    <div class="handle">
      <tm-button plain round type="default" icon="arrow-left" @click="back">
        返回
      </tm-button>
    </div>
  </div>
</template>

<script>
export default {
  props: ["error"],
  methods: {
    back() {
      this.$router.back();
    },
  },
};
</script>

<style lang="less" scoped>
.error {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;

  .code {
    text-align: center;
  }

  .message {
    text-align: center;
  }

  .handle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>
